<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<script type="text/javascript">
	var visist = "";
	var demoList = "";
	var realList = "";
	$(function() {
		var hdw = $('.z_tab li');
		hdw.click(function() {
			$(this).addClass('dq').siblings().removeClass();
			var hdw_index = hdw.index(this);
			ajaxChart(hdw_index);

		});

		ajaxChart(3);

	});
	function ajaxChart(type) {
		var params = {
			'type' : type
		};
		jQuery.getJSON("${ctx}/staticChart/ajaxStatsicCharts.ac", params,
				function(data) {
					visist = data.visitLists;
					demoList = data.visitTodayLists;
					realList = data.visitAvgLists;
					showChart(visist, demoList, realList,type);

				});
	}
	function showChart(visist, demoList, realList,temp) {
		$('#containerTemp').highcharts(
				{
					chart : {
						type : 'spline'
					},
					title : {
						text : ''
					},
					xAxis : {
						labels : {
							formatter : function() {
								if (this.value < 10) {
									this.value = "0" + this.value;
								}
								return this.value+":00";
							}
						}
					},

					yAxis : {
						
						title : {
							text : ''
						},
						allowDecimals:false,
						lineWidth:1,
						min : 0
					
						
						
					},
					tooltip : {
						formatter : function() {
							var titl="";
                          if(temp==0){
                        	  titl="访问数";
                          }else if(temp==1){
                        	  titl="咨询数";
                          }else if(temp==2){
                        	  titl="模拟开户数";
                          }else if(temp==3){
                        	  titl="真实开户数";
                          }else if(temp==4){
                        	  titl="首次入金数";
                          }
                     
							return '<b>' + this.series.name +"  "+ this.x+":00"+'</b><br/>'
									+titl+":  "+ this.y;
                          
						}
					},
					credits : {
						enabled : false
					},

					exporting : {
						enabled : false

					},
					series : [ {
						name : '今天',

						data : visist
					}, {
						name : '昨天',
						data : demoList
					}, {
						name : '最近七天平均',
						data : realList
					} ]

				});
	}
</script>
<div class="z_tab">
	<ul>
		<li >访问数</li>
		<li>咨询数</li>
		<li>模拟开户数</li>
		<li class="dq">真实开户数</li>
		<li>首次入金数</li>
	</ul>
</div>

<div id="containerTemp"
	style="height: 400px; min-width: 1380px; margin:50px 25px 0 25px "margin-top: 50px;></div>